UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't+cL0Zw+Mt78y1Q9PyuVh3+IrErg0n6G4pDXJGPUTjU='
WHERE
key_id = '5e674316eee41daa80cf35a8ce6d5a733638fcedde5fe06081a26e6d679a235b'
AND (
token = 't+cL0Zw+Mt78y1Q9PyuVh3+IrErg0n6G4pDXJGPUTjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)