UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yYThj7NItrJdSqzCJPwivPE68XpM7hVDcIon5o/4ECw='
WHERE
key_id = 'b9c5e792ca9e0e23754426dedee4d6cfc37842b68793053a7c18792836b1bd28'
AND (
token = 'yYThj7NItrJdSqzCJPwivPE68XpM7hVDcIon5o/4ECw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)