UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's7ECjkPflhIhFM2dHP0Kw8YHI9++LtDADWKyKouJJ7A='
WHERE
key_id = '5858d0b7dd7502c186b7e6c08166fdbbcb02ac05f8ef3ed9ed68931278b37068'
AND (
token = 's7ECjkPflhIhFM2dHP0Kw8YHI9++LtDADWKyKouJJ7A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)