UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l9WBux4+gEDieKqUyrdUNFep84sRKv6igQ26cT9K5cQ='
WHERE
key_id = 'ff3f129b03c31af1c07845508d9ceaef3ef54ecc39bd3d6f207a5f6cc8ec5be6'
AND (
token = 'l9WBux4+gEDieKqUyrdUNFep84sRKv6igQ26cT9K5cQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)