UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5vZmBjxvOrISUnpXBorUrMiOAVxKEeWYJEbVcLL4jVM='
WHERE
key_id = '2083b9d6f4108a75ea0e8db59b5bc130e16f995056d302da66b3dc529f64eb67'
AND (
token = '5vZmBjxvOrISUnpXBorUrMiOAVxKEeWYJEbVcLL4jVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)