UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1A8GxYzBEW3YZ1sRlxOkvbvKw7Q+dWRjL1GIhkMBP+s='
WHERE
key_id = '64c53bb41fac0e659a37f23d021d25ee42c8e9bb850e04f5fb04411a7a185ef3'
AND (
token = '1A8GxYzBEW3YZ1sRlxOkvbvKw7Q+dWRjL1GIhkMBP+s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)