UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WW9z1wsqkDHzOstlEA7uDP8lgxX/e+x8sbtq1nPRgUQ='
WHERE
key_id = 'b28a6ec989a8c554d0cf29ad5d35eba887062a98ac07f3f2aaa292e8ff35232e'
AND (
token = 'WW9z1wsqkDHzOstlEA7uDP8lgxX/e+x8sbtq1nPRgUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)