UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IaiOEoRoy/hGcf4AkYmqvJaj94vhG+BGqFiBo5ZVBac='
WHERE
key_id = 'a911a523a4e6879c44753d9b45efbe07c1770764a75945e3289b8f2bc3677a3e'
AND (
token = 'IaiOEoRoy/hGcf4AkYmqvJaj94vhG+BGqFiBo5ZVBac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)