UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '06vm71Bf1hQlGN3KnH8ROn1TI0p3jlEFvXHlCTTnYLc=' 
WHERE 
  key_id = 'e35e5069c5ab87bc9311cab2ce8776fa65823d96bed40be1a9550e44e3b33c0b' 
  AND (
    token = '06vm71Bf1hQlGN3KnH8ROn1TI0p3jlEFvXHlCTTnYLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031