UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XYnAStJUcRtMPoBTV3asmzsAQByQbUXtjspTgXAW9d8='
WHERE
key_id = '3bb061ceee179dc5a325f268e7348ba1e290d1c61be8df4bdd4cbb69f8e8f191'
AND (
token = 'XYnAStJUcRtMPoBTV3asmzsAQByQbUXtjspTgXAW9d8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)