UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sjWT+pRQKCpU6KjlBR1rklzDOPDM5imMeRUF6KziKqQ='
WHERE
key_id = 'fbe9b766f6338c73681c0f60b31d0e83c04317882a902757cd6770017315c495'
AND (
token = 'sjWT+pRQKCpU6KjlBR1rklzDOPDM5imMeRUF6KziKqQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)