UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TiyRE0x59Vq1hb9xbKEm6M/xlykfjs8XEu6ZoNKNHN8='
WHERE
key_id = '2759c7ef919b26cfffff6da8cf41cf878ab7ea8348c09f2003acb0760c2ff821'
AND (
token = 'TiyRE0x59Vq1hb9xbKEm6M/xlykfjs8XEu6ZoNKNHN8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)