UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GzKcN+sO4e5u1u8WJ5dLky/Vpov8U1bHoDkvput3ihc='
WHERE
key_id = 'f4ce8c9bce26d36cb829903c57eed76f9bb8a970e3c09d6d128a88a11b191253'
AND (
token = 'GzKcN+sO4e5u1u8WJ5dLky/Vpov8U1bHoDkvput3ihc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)