UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oc89J+PqeERwR+KHIa/QU329v/QbaLqC3muAKEM2LRo='
WHERE
key_id = '4b40b801d79ba3164a9fed65eba6da12d7426d70b3943b92c4a5cce430547d42'
AND (
token = 'Oc89J+PqeERwR+KHIa/QU329v/QbaLqC3muAKEM2LRo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)