UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v7FQF+g0ujkoulu73PWSIhiReCfvgUbgy3B2IClGL+Q='
WHERE
key_id = 'b6527f55f856ed5b5689cd8720bfe5b48f6b1cd83584c0ad3c529fc0467f2238'
AND (
token = 'v7FQF+g0ujkoulu73PWSIhiReCfvgUbgy3B2IClGL+Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)