UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b/TIc4gEcp5FY0uHKnG9xQBmt8H5Q9e0tHIp+TsxHrs='
WHERE
key_id = '9a677061c4302cfc88db81901add186a8938f2573edfcbea28b2afc6b70a25cc'
AND (
token = 'b/TIc4gEcp5FY0uHKnG9xQBmt8H5Q9e0tHIp+TsxHrs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)