UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pXqfmI4di6oZ0RAS4UTEpXh+J611fgdBtJsy6x2BePU=' 
WHERE 
  key_id = '7d055074c72eebb21c5dfcf470c456c250001e61cf7af856c0254d7bc1e05e02' 
  AND (
    token = 'pXqfmI4di6oZ0RAS4UTEpXh+J611fgdBtJsy6x2BePU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023