UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dSvDOcNT/uakkm7Zas0Xe1NzvTAlyJO0ZZkNfXO+N44='
WHERE
key_id = 'af61ba75eddcb6fe8bddb619a0c54349516a6836c10aa131c0af155ec7a9a248'
AND (
token = 'dSvDOcNT/uakkm7Zas0Xe1NzvTAlyJO0ZZkNfXO+N44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)