UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TfaV5D06lrl6XyS7xl1RYTlxVn1nXQbtaB74Z8T2uLo='
WHERE
key_id = 'd83155ef6a3f08bec154e8a1adacfdc8deacbc87a543040e44d595676103d8f6'
AND (
token = 'TfaV5D06lrl6XyS7xl1RYTlxVn1nXQbtaB74Z8T2uLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)