UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bOne1pp1ciyUyf3/RNGXAWuQvI9zIb3DaeIYqTvmmQQ='
WHERE
key_id = 'a5a9090462c9bbf9b6fffd0d2065868d99f54513a23a0f477753bd83c81d0c7a'
AND (
token = 'bOne1pp1ciyUyf3/RNGXAWuQvI9zIb3DaeIYqTvmmQQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)