UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RX0e98NAYWy6n36d5p2qLBitbJIKL/l3kU7vh3z6Ye4=' 
WHERE 
  key_id = '764e25a6936b0b3e655c3d3ec0ae01d613d0a984ab7bbac69f80c7339b123a79' 
  AND (
    token = 'RX0e98NAYWy6n36d5p2qLBitbJIKL/l3kU7vh3z6Ye4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035