UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xqv2oRXSX4/ADOL2w7LPO4sz4x7mzOCmCPaqGG2QwCs='
WHERE
key_id = 'c3f4b74c87cc879541a15fab89c6d96851f934b5a3efbe593cbb971e52c37756'
AND (
token = 'Xqv2oRXSX4/ADOL2w7LPO4sz4x7mzOCmCPaqGG2QwCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)