UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qc/KlkdgmSX0b3OvAUBs5G1OrjxbD+GZi18gV2s6OGM='
WHERE
key_id = '2520001fac6c57c408fcc4b367f9cae48f03971487ea545ae42256fe316ce3c5'
AND (
token = 'Qc/KlkdgmSX0b3OvAUBs5G1OrjxbD+GZi18gV2s6OGM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)