UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JEtymVvNAlpuHlWNVEzy+DNLz2Kv9KoR18P36rPER7E='
WHERE
key_id = '17ddae9f4caad483a31e30b3e7734a05088c70860ed80faf28ea2c316de9d52f'
AND (
token = 'JEtymVvNAlpuHlWNVEzy+DNLz2Kv9KoR18P36rPER7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)