UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XxUuLhymYZw4YWVTeLr3SfgfSBtyYTN00ZNN2/ATwsg='
WHERE
key_id = '9e6b614b20f0519b8bab149bcbd7544351ce1d3fde0fce2804b93bb233cdf347'
AND (
token = 'XxUuLhymYZw4YWVTeLr3SfgfSBtyYTN00ZNN2/ATwsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)