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