UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sFey1r3We4RO8VLR/jp6nEAm86ruj1Cy5IPVIe4ufCg='
WHERE
key_id = '5045c19b8283506f267868790d68ba7d28b337224d3b4518fa30c8dcb22a1ad3'
AND (
token = 'sFey1r3We4RO8VLR/jp6nEAm86ruj1Cy5IPVIe4ufCg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)