UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wmD6p4ExlWp4LEBKWYDm8EfrrHCwn3HEg5p8+Jp2LI4='
WHERE
key_id = 'a99c163e595227d39319aeb218656666f83833cf2600e2c7ecc2d20fc43aa638'
AND (
token = 'wmD6p4ExlWp4LEBKWYDm8EfrrHCwn3HEg5p8+Jp2LI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)