UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'omToa+1aXJeCuIM0LEFNUPJfIL5zzzSp9lVy/BhpOG0='
WHERE
key_id = '564d794330aa3b08cb734e7a33b923cb0852a6de652bce6055b3ac3f539ba108'
AND (
token = 'omToa+1aXJeCuIM0LEFNUPJfIL5zzzSp9lVy/BhpOG0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)