UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xcrru/0Lb9NHWRFdl55ULA7ivZTH7EjtOKlLh+QqVYE='
WHERE
key_id = 'bf461f3d4da49a67e7c0c9536a79eafb829fe229c72ac1ee35114fee6d909bfc'
AND (
token = 'xcrru/0Lb9NHWRFdl55ULA7ivZTH7EjtOKlLh+QqVYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)