UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fDtOmxSzWVwDRMa+md3LgrGAWyYLuD5P0X5D4jR3jx8='
WHERE
key_id = 'fc528c203b880eacd10adcfa55b9d450b8d67d5319576ca31534ef92bc76b468'
AND (
token = 'fDtOmxSzWVwDRMa+md3LgrGAWyYLuD5P0X5D4jR3jx8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)