UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'swjt9wxP9IwgpRg2SlVt6OK2LqRoOtzFNGxQwnWzS28=' 
WHERE 
  key_id = '75238ed1a7392744d3736afdcde5d6dc7260650789352b960dbbf1e5baca6740' 
  AND (
    token = 'swjt9wxP9IwgpRg2SlVt6OK2LqRoOtzFNGxQwnWzS28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021