UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WCTOAQsZoSt+Am6EPKIVo/V6A3eqM7Mc9yPQ2l7OHtU=' 
WHERE 
  key_id = 'cea5db74332dfa9210ea76488fdf7df97393c9d876ada28cc49ef72af51ebb7b' 
  AND (
    token = 'WCTOAQsZoSt+Am6EPKIVo/V6A3eqM7Mc9yPQ2l7OHtU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030