UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vrX58YgyDX+JUWUTLHnLlHdE0dm9C8Dmvsf02KYf4/g='
WHERE
key_id = 'abfdd6dc3bf5bda4467c00194c6366e8c36a37e79082e4ee46bd4586cfd15833'
AND (
token = 'vrX58YgyDX+JUWUTLHnLlHdE0dm9C8Dmvsf02KYf4/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)