UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R6FxfqNJvMIzkwf5qYUVWBF7vHrik4ZSTKgWvpaLK8Q='
WHERE
key_id = '6e4d1bc45c31e0aee9dd063b169f9396084967e2e4184e7d15ff11b01245835e'
AND (
token = 'R6FxfqNJvMIzkwf5qYUVWBF7vHrik4ZSTKgWvpaLK8Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)